package com.levi.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.levi.pojo.Product;
import org.springframework.stereotype.Service;

import com.levi.mapper.ProductMapper;
import com.levi.service.ProductService;

/**
 * @author shentong
 * @since 2022/6/12 11:47 AM
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product>
                            implements ProductService {

    @Override
    public boolean decut(Integer id,Integer count){
        Product product = this.getById(id);
        product.setStock(product.getStock() - count);
        this.updateById(product);
        int i = 1 / 0;
        return true;
    }
}
